package 公司真题.美团;

import java.util.Scanner;

public class _烤面包 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextLine()) {
            String di_yi_hangshuju = sc.nextLine();
            String di_er_hangshuju = sc.nextLine();
            String[] oneArr = di_yi_hangshuju.trim().split(" ");
            String[] twoArr = di_er_hangshuju.trim().split(" ");
            int[] one_int_arr = new int[oneArr.length];
            int[] two_int_arr = new int[twoArr.length];
            for (int i = 0; i < one_int_arr.length; i++) {
                one_int_arr[i] = Integer.parseInt(oneArr[i]);
            }
            for (int i = 0; i < two_int_arr.length; i++) {
                two_int_arr[i] = Integer.parseInt(twoArr[i]);
            }
            String msg = "YES";
            int maxWeight = one_int_arr[2] > one_int_arr[3] ? one_int_arr[2] : one_int_arr[3];
            boolean isMax = false;
            boolean isMin = false;
            int minWeight = one_int_arr[2] < one_int_arr[3] ? one_int_arr[2] : one_int_arr[3];
            for (int i = 0; i < two_int_arr.length; i++) {
                if (two_int_arr[i] > maxWeight || two_int_arr[i] < minWeight) {
                    msg = "NO";
                }
                if (two_int_arr[i] == maxWeight) isMax = true;
                if (two_int_arr[i] == minWeight) isMin = true;
            }

            if ("NO".equals(msg)) {
                System.out.println("NO");
                continue;
            }

            if (isMax && isMin) {
                System.out.println(msg);
                continue;
            }

            if (!isMax && !isMin) {
                int num = one_int_arr[0] - one_int_arr[1];
                if (num >= 2) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
                continue;
            }

            if (isMax || isMin) {
                int num = one_int_arr[0] - one_int_arr[1];
                if (num >= 1) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
                continue;
            }
        }
    }
}
